drag and click

I have used both the onTaskClick and onTaskEndDrag events. But when i drag a task bar , the onTaskClick event is also called. How do i avoid this?