add debug helper function to app controller