added handling of getting tot he last wp