Fixing if_statement test