fixed bug that caused crashing (TODO fix the .remove() )