fixes for issues 20 and 21