adding if/else functionlaity