Added admin panel for sonataadmin and fixed a memory leak.