Added some conditions.