fix bug which adds method ref only for Main not for the correct class name