fixed some bad recursion
added if