added more conditions