For creating record in db, removed [0] and added .first to gem code