Code cleanup, timeout was not being set correctly