Fix bug in idf