fixed for issue #20
fixed for issue #21