Fix le bug detached entity passed