modify play function