added save functionality to entities