quick fix for issue #14, this prevents just the crash and does not solve the origin of the bug