Added function to allow profile object to be added to database