fixed merged code