Improved security. (Checked all paramter inputs to prevent injection etc)