Check if next empty cell

@trunghai

this topic is somewhat relevant to this.