addressed crash issue #6