better handling of sqlalachamy