added key code and query file