fixed error handling
changed main script name