fixed keydir bug