enhance pop, add support for default value