It looks like the sql argument is never actually passed here, you can just make it a required arg.