fixing issue #312