Adding stop funciton