removed unnecessary if (condition shouldn't be false) and turned off remote frees - without them everything works now