added if condition to app.html to prevent nil