Fix database lookup