added method for checking password