improve efficiency & fix bug for detecting meta changes