fix day of week calculation