Added checking for Message.last.nil?