improving functionality of compose modal