Added check if bit is valid