fixed space errors in allocation
fixed variables and function implicit freeing
engine version 1.2.7