Update app.php

Tiny tweak: check if function exists