fix array borders problem