adjust width and height for animation