added option to set amount of sleep time