#5 added mInput.free() to cleanup