Fixed bug with toggle function.