resolve errors in controller