added rotate function to client side