Revert "Remove unecessary check"

This reverts commit dd62d60064de2ab60765986b6c47cabe76701aa3.