minor nit: this should be in the else clause of the if below.  No need to assign twice.