Now the collision happened both on x,y axis

The collision happened both on x-axis and y-axis.