fixing php errors and created setup_property function