added limit in a stack, fixed memory leak when there is now entire frame