checking fixing errors len func