Fixed NullPointerException that may happen on timeout