avoding npe (fixes #6)