deleting extra space in index code