fixing set_timeout usage, fixing windows bug