Revert "Removed unnecessary checks"

This reverts commit fa9a62424083c0aad01547437dc86e36044697fe.