small nil error problem fixed