callback interface implemented for resource handling, some bugfixes