fix list creation
fix template function to support firefox