Delete for-loop causing troubles