Database method checked wrong table