Added setApplication call to correctly set the application.