added find_current_app function