Made changes to the delegate methods