updates to get modal close sequence right