added code checks