JavaScript error fixed - collapse