min and max returns value instead of key