fixed bug with removing inputs from gate