Tried to add close() and slice() but failed