added directory constants, and potentially fixed blocking issue with retries and a timeout