Removed debug line

Removed console.log() as debugging this section is no longer needed.
Fixed conditional

Updated conditional for more accurate variable checking.