Changed output of errormsg to canvas instead of displaying alert