corrcting a bug while generating entries