simplified error handling as this is already done on the outside