added init and finalizer for compiler