update readme and fix tail detection