this fixes #1 and also resolves #2 issues