fixed last error handling after php process finished