Made a better SQL call