implemented play and pause