Fixed defect with where caluse. Now defuaul values are applied in LEFT JOIN instead of nil