added code from next dev iteration