Fixed code bug