 
   robot.hear /booklist review book (\d{1,5}) stars (\d{1})/i, (res) ->
     index = res.match[1]
-    reviewRating = res.match[2]
+    reviewRating = parseInt(res.match[2], 10)
+
+    if reviewRating > 5
+      return emitString(res,"Ratings must be between 1 and 5")
 
     maxIndex = getBookList().length - 1
     if index > maxIndex


    book[BOOK.RATING].value = newAverage
    book[BOOK.REVIEWCOUNT].value = nbrOfReviews



  getLastBook = ->
    booklist = getBookList()

      fields: [
        { short: true, title: "Author", value: book[BOOK.AUTHOR].value }
        { short: true, title: "Category", value: book[BOOK.CATEGORY].value }
        { short: true, title: "Average Rating", value: if book[BOOK.RATING] then book[BOOK.RATING].value else "0"}
      ]

    cb(payload, null)
