add endplay logic
fixing the problem