fixing issue #21
fixing issue #12