small bug fix, still needs more fixes