fix method defined before its class