Fixed code per review comments