fixed ticket #379
Fix for PR 388