Fixing doctrine not being set issue