Using current_app instead of state variable