adjusted error/succcess handling