fixed getlatestitems method