fixed async bug with element registration