make lang optional and handle meta data correctly