added comments and put in key error buffer