wip
WIP fixing error handling
function for throwoom