Script error when closing map modal

Story: https://www.pivotaltracker.com/story/show/65715072