added fail statement, added console log for data returned