corrected functionality