modified launch function