fixing issues mentioned in #6