Issue #1004

fixing for that according to william proposal