fixed critical protection bug (closes #579)