Added some sanitization and validation stuff