bugfix

fixed a bug when removing first element didn't work correctly