More Error Handling + defines