Function to check if user filled in correct password, else script starts endless loop