fixed undefined constant errors
fixed more undefined constant errors
fixed undefined constant errors
delete unecessary code
fixed injection vul