fix element doesn't exist error