Fixed error conditin statement for callback