modified to if.. else.. condition