added callback parameter to play function