added lookup to database before data entry