Fixed bug with conditional