fixed issue #6 thanks @gpoo