added license check when creating apartments