fixed problem with the undefined add level function