fix app function