more error handling
fixes for postinstall hook