fixing issue where expire length was ignored