Removed unnecessary inDOM check