Added error checking in addPoints