added some missing dependencies and changed behaviour on error