add optional_where method