Fix Entity Manager Issue