added pwd check