Fix resource handler bug