Added stop function to top level