STABLE settimeout fixing race conditions. will need to do more research