fixed bug with modal close event