Fixed major security hole with user input
several changes added inculding security fix