fixing set locations function