fix crash reported by ankostis