add logging when incorrect code is used