Fix for SQL injection: https://github.com/wends155/ADS/issues/2

Implemented the security fix posted in the issue: https://github.com/wends155/ADS/issues/2