added block drawing condition