added code to adapter