fixed small key error bugs