cleared 0 in stead of 10 bug out of check_keys function