trying to fix type error