changed sed in to take bash vars