how to prevent hair loss and dandruff