fix TypeError in formats