add create location function