free node on error
fixed wrong variable assignment
fixed forgotten input parameter