added code before and code after