added self-update functionality