Fixed potential security issue, formatted code