fix free space sql and remove equeue check