Removed javascript error and set to proper variable