fixed keysec issues