small bug fix, need to improve design