Added functionality to check password