fixing code validation bugs