adjust start & end logic