added level checking