fixing issues with bug #5