youve got air in the valve bock
NEVER let the master cylinder resivour run empty or it will give you the problem you describe
you have to bleed the valve block by bleeding the return from the master clyinder to the blaock, but i can't remember now it's too late