Fixed code as per admin comments.