Fixed issue of Seg fault when user clicks outside the board