Trying to fix nosuchmethod error