Fixed #1 adding validation