fix predict method