Added conditional statement.  Tested out correctly.