removed a redundant variable check