if clauses not working else ok