Add a missing condition

This could've led to an "to" undefined error.