fixed '\0' to NULL