Fixed wrongly nested function