added handling for not having a main property