fixed issue #400
my solution for issue #400