add proper elem check