better error handling

fixed for CanCan