added correct table name in if statement..