fixing js initialization