included some further error handling