fixed possible crash introduced by prior commit