added error handling to apache role