Removing line causing memory exhaustion