moved some logic ..