fixed strange bug
removed unused variable