add timeout state in ErlangProcess; better error checking