Fixed functionality bug