fixes a bug introduced by misleading use of strncmp