adding robustness checks to controllers