fixing a bug on method call