fixes error in 3.5.1; $locations should be an array