added code checking