Fixing doctrine fatal error