fixing bug #799