Added helper functions to verify password