fix scroll logic