add return to endPlay function