added some errors when planid or user is null