fixed bug in compute_date