add check on magic value