added a close method to cleanup the receiver