update_locations is really close, working in console but not through form