fixed entity bug