added function to log unauthorized calls