Fix possible SQL injection vulnerability in manager