Fix bug where app handler was defined twice