add tail and head