Hiding/showing checkbox when it is needed or not