debugging: Moving flap definition into whenLoaded block