adding sleep functions