Update app.c code