added set timeout function