creating handler for app