Fixes bug when a selected block is removed