added code for pulling has many relationships