fixes #49 by introducing an additional check