added error message and added documentation for BaseController