Fixed small bug in delete task function