added code for animatedButton