strange max recursion error solved (maybe)