fix negative timeout value