Fixed notice in buildRequest function