this is a first fix for the domain error problem
Merge pull request #2 from urbach/fixDomainError

Fix domain error