trying to fix the error on a method via calling a function from one class to another