Is it OK to return empty hash instead? otherwise I do not understand much this specific code, so otherwise I do not see anything suspicious.