try to fix some type issues