fixed leak bug in sandbox, added modes