fixed bug: calculate expire