fix to not have to use `main_app` in the views all the time

thanks to http://stackoverflow.com/a/15958799/3714014