added function to log attempt