add handling for sleep
apply design