Fixed require statements by putting them inside the tasks in which they are used