Fixing SQL injection issue by restructuring the system