Fixed environments modal not closing bug