fixed first part of issue #55