moved residence object into app scope