fixing layouts and pagination