How to avoid instant GetMouseButtonDown-checking when instantiating object with button?

I am instantiating objects when I press ui-buttons. I want to move them around until as I click again, but unfortunalty because of pressing the ui-button it releases it instantly. Even if I set a bool flag to check on the next Frame it dont work.

void Update () {
	if(currentObj)
		MoveObject();
}

void MoveObject(){
	//Movement
    currentObj.position = Input.mousePosition;

	if(instantiated){ //Check on next frame to avoid instant placing
		if(Input.GetMouseButtonDown(0))
			currentObj = null;//Release it
	} else
		instantiated = true;
}

public void InstantiateObj(string obj){
	instantiated = false;
	currentObj = Instantiate(Resources.Load(obj), Vector3.zero, Quaternion.identity) as Transform;
}

I hope this is you want:

public bool IHaveObject;
    void Update()
    {
        if (currentObj)
        {
            MoveObject();
        }
        if(Input.GetMouseButtonDown(0))
        {
            if(IHaveObject)
            {
                IHaveObject = false;
                currentObj = null;
            } else
            {
                IHaveObject = true;
                InstantiateObj("YOUR OBJECT");

            }
        }
    }

    void MoveObject()
    {
        currentObj.position = Input.mousePosition;
    }

    public void InstantiateObj(string obj)
    {
        currentObj = Instantiate(Resources.Load(obj), Vector3.zero, Quaternion.identity) as Transform;
    }