Bug fix, database JOIN