fixing getNumberOfElements