add condition to check if end stake is after the previous end stake