Removed timeout and changed bools to atomic