fixed reference to database