added a null check in haiku.py