fixed bug #28
fixed issue #26
fixed issue #23