fixed some errors with the sql source