fixed possible unbound error