bug fix on modal opening