fixed #286. onclick wasnt being updated