unit dx and dy fix