updated code due to the github comments