fixed wrong if logic..