sleep added to every function