bug fixing for markError