fixed sql to only reference fn and ln