add error handler for categories add, dalete