check start and end