Removed unused code and clear fragments from the stack

Signed-off-by: anfor <ainhoamm85@gmail.com>