fixes #567 and resolves #568