fixed enum name
fixed enum name
fixed enum name
added handler factory for better error checking
catch error