Move createModal from event to after load complete